Skip to content

Conversation

mikpe
Copy link
Contributor

@mikpe mikpe commented May 30, 2025

Otherwise the build may pick up a different one which won't work since BEAM depends on its own modifications to pcre2.h.

Fixes:

beam/erl_bif_re.c:747:2: error: call to undeclared function 'pcre2_free_restart_data'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  747 |         pcre2_free_restart_data(rc->match_data);
      |         ^

(and several more) when building OTP-28.0 on a mac with pcre2.h installed in /opt/homebrew/include/.

The issue can occur on any system where CFLAGS has -I addons set to pick up additional headers not installed in the traditional locations known natively by the compiler, i.e. outside of /usr/include/. The end result is a compile command where those -I addons precede the -Ipcre that BEAM adds, and the wrong pcre2.h is selected.

Since BEAM has to use its own pcre2.h, the fix is to use an absolute path relative the source file when including it.

Otherwise the build may pick up a different one which won't work
since BEAM depends on its own modifications to the pcre2 API.
Copy link
Contributor

github-actions bot commented May 30, 2025

CT Test Results

    3 files    142 suites   50m 5s ⏱️
1 649 tests 1 592 ✅ 57 💤 0 ❌
2 372 runs  2 295 ✅ 77 💤 0 ❌

Results for commit aa76920.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@rickard-green rickard-green added the team:VM Assigned to OTP team VM label Jun 3, 2025
@garazdawi garazdawi requested a review from sverker June 9, 2025 10:10
@sverker sverker changed the base branch from maint-28 to maint June 9, 2025 10:54
@sverker sverker added fix testing currently being tested, tag is used by OTP internal CI labels Jun 9, 2025
@sverker sverker merged commit 2162b3a into erlang:maint Jun 12, 2025
40 of 42 checks passed
@sverker
Copy link
Contributor

sverker commented Jun 12, 2025

Merged to maint but also put in queue for next maint-28 release.

@mikpe mikpe deleted the select-correct-pcre2-header branch June 12, 2025 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix team:VM Assigned to OTP team VM testing currently being tested, tag is used by OTP internal CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants